package com.woniuxy.store.core.mapper;

import com.woniuxy.store.core.model.PlOrderitem;
import com.woniuxy.store.core.model.PmEvaluate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gmx
 * @since 2021-07-05
 */
public interface PmEvaluateMapper extends BaseMapper<PmEvaluate> {
    @Select("SELECT * FROM pm_evaluate WHERE order_id in (SELECT id FROM pl_orderitem WHERE store_id=#{storeId})")
    List<PmEvaluate> selectList(Integer storeId);

    @Select("SELECT * FROM pl_orderitem WHERE id=(SELECT order_id FROM pm_evaluate WHERE id=#{id})")
    PlOrderitem selectOrder(Integer id);
    @Select("SELECT * FROM pm_evaluate pe,pl_orderitem po WHERE pe.order_id=po.id AND pe.id=#{id}")
    List<PlOrderitem> selectOrderByEvaluate(Integer id);
}
